﻿
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using AutoMapper;
using CoreCms.Net.Auth.HttpContextUser;
using CoreCms.Net.Configuration;
using CoreCms.Net.IServices;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.Entities.Expression;
using CoreCms.Net.Model.FromBody;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Utility.Extensions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using SqlSugar;
using CoreCms.Net.Services;

namespace CoreCms.Net.Web.WebApi.Controllers
{
    /// <summary>
    /// 
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class HotsearchController : ControllerBase
    {
        private IMapper _mapper;
        private readonly IHttpContextUser _user;

    
        private IHotsearchServices _HotsearchServices;
   

        /// <summary>
        /// 构造函数
        /// </summary>
        public HotsearchController(IMapper mapper
            , IHttpContextUser user
                 , ICoreCmsGoodsCategoryServices goodsCategoryServices
                , ICoreCmsGoodsServices goodsServices
            , IHotsearchServices HotsearchServices
              



        )
        {
            _mapper = mapper;
            _user = user;
       
            _HotsearchServices = HotsearchServices;
        
        }


        [HttpGet]
        public async Task<WebApiCallBack> GetList()
        {
            var jm = new WebApiCallBack();

            jm.data = _HotsearchServices.Query(); ;
            jm.status = true;

            return jm;
        }


    }
}
